package cn.kgc.spring.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

/**
 * @author: mosin
 * @version: v1.0  2022/4/23
 */
@Data
@AllArgsConstructor
@Builder
@Service
@Scope("prototype")  // 作用域设置
public class Book {
    @Value("12.5")
    private double price;
    @Value("tom")
    private String author;
    public Book(){
        System.out.println("book 对象被创建");
    }
}
